package com.itheima.a05myset;

import java.util.TreeSet;

public class A05_TreeSet5 {
    public static void main(String[] args) {
        //创建集合
        TreeSet<Student> ts = new TreeSet<>();

        //创建对象
        Student s1 = new Student("zhangsan", 23);
        Student s2 = new Student("lisi", 24);
        Student s3 = new Student("wangwu", 25);

        //添加元素
        ts.add(s1);
        ts.add(s3);
        ts.add(s2);

        //打印输出
        System.out.println(ts);
    }
}
